﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MyLocalChurch.Error
{
    public partial class Oops : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            var ctx = HttpContext.Current;
            var exception = ctx.Server.GetLastError();

            txtErrorMessage.Text = string.Concat("Offending URL: ", ctx.Request.Url, Environment.NewLine,
                                                 "Source: ", exception.Source, Environment.NewLine,
                                                 "Message: ", exception.Message, Environment.NewLine,
                                                 "Stack trace: ", exception.StackTrace);
        }
    }
}